package MyDoublyLinkedList;

import java.util.EmptyStackException;

public class TestDemo {
    public static void main(String[] args) {
        MyDoublyLinkedList myDoublyLinkedList = new MyDoublyLinkedList();

        myDoublyLinkedList.addLast(1);
        myDoublyLinkedList.addLast(2);
        myDoublyLinkedList.addLast(4);
        myDoublyLinkedList.addLast(2);
//        myDoublyLinkedList.addLast(1);
        myDoublyLinkedList.display();

        MyDoublyLinkedList myDoublyLinkedList1 = new MyDoublyLinkedList();
        myDoublyLinkedList1.headNode = MyDoublyLinkedList.partition(myDoublyLinkedList.headNode, 3);

        myDoublyLinkedList1.display();
    }


    public static void main1(String[] args) throws EmptyStackException {
        MyDoublyLinkedList myDoublyLinkedList = new MyDoublyLinkedList();

//        myDoublyLinkedList.addLast(6);
        /*myDoublyLinkedList.addFirst(1);
        myDoublyLinkedList.addFirst(2);
        myDoublyLinkedList.addFirst(3);
        myDoublyLinkedList.addFirst(4);
        myDoublyLinkedList.addFirst(5);*/

        myDoublyLinkedList.addLast(1);
        myDoublyLinkedList.addLast(1);
        myDoublyLinkedList.addLast(1);
        myDoublyLinkedList.addLast(1);
        myDoublyLinkedList.addLast(1);
        myDoublyLinkedList.display();

//        try{
//            myDoublyLinkedList.addIndex(-1,1);
//        } catch (EmptyStackException e) {
//            e.printStackTrace();
//        }
//
//        myDoublyLinkedList.display();

//        System.out.println(myDoublyLinkedList.contains(0));

//        myDoublyLinkedList.remove(3);
//        myDoublyLinkedList.display();

//        myDoublyLinkedList.removeAllKey(1);
//        myDoublyLinkedList.display();

//        myDoublyLinkedList.clear();
//        myDoublyLinkedList.display();
//        System.out.println("========");
    }
}
